#if 0

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
//#include <string>
//#include "hashtable.h"
#include "list.h"
#include "gen/error_macros.h"
//using namespace std;
//package symbols;
//#define CAPACITY 1000000
#define RUNS 1000000
#define BOUND 1000000
//enum Type {Interger, Float, Bool, Image, Degree, Pair, String};

struct myEntry {
	char* name;
	char* type; 
	char* value;
};

struct Env {
	List Stable;
	struct Env* prev;
};

void init_Env (struct Env * self, struct Env * p) {	
	struct myEntry *entry = (struct myEntry*) malloc(sizeof (struct myEntry));
	ListIter *ptr;
	memset(&(self->Stable), 0, sizeof (self->Stable));
	construct(List, &(self->Stable),sizeof(struct myEntry),FREEOBJ);
	self->prev=p;
	/*
	entry->name = "null"; entry->type = "null"; entry->value = "null";
	push_front_List(&(self->Stable), entry, sizeof(struct myEntry), DYNAMIC);
	ptr=(ListIter*)front_List(&(self->Stable));
	printf("%s", ptr);
	*/
}

void put_Env (struct Env* self, struct myEntry* entry) {
	ListIter *ptr;
	/*
	char* V=entry->value;
	for( int i=0; i<strlen(V) ;i++){
	int j=0;
	if (V[i] != '[' && V[i] != ']'){
	entry->value[j]=V[i];
	j++;
	}
	}
	*/
	push_front_List(&(self->Stable), entry, sizeof(struct myEntry), DYNAMIC);

	//ptr=(ListIter*)front_List(&(self->Stable));

	//printf("%p",(struct myEntry*)ptr);
}

struct myEntry* get_Env (struct Env *self, char* s) {
	struct Env * e;
	//ListIter *ptr;
	//ListIter *ptr2;
	for (e = self; e!=NULL; e=e->prev){		

		ListIter *ptr1; 
		ListIter *ptr2;
		ListIter *ptr;
		//	printf("get ");
		ptr1=(ListIter*)front_List(&(e->Stable));
		//	printf(" %p", (struct myEntry*)ptr1);
		ptr2=(ListIter*)back_List(&(e->Stable));
		//	printf(" %d", sizeof (struct myEntry));
		if (ptr2!=NULL){
			for(ptr=(ListIter*)front_List(&(e->Stable)); ptr!=(ptr2-7); ptr=ptr-7){
				//		printf(" in");
				//		printf(" %p", (struct myEntry*)ptr);
				//	printf(" %s", ((struct myEntry*)ptr)->name);
				//printf(" %d", sizeof ptr);
				//printf(" %d", sizeof (((struct myEntry*)ptr)->value));
				//for(ptr=(ListIter*)front_List(&(e->Stable)); ptr!=(ptr2-14); ptr=ptr-14){
				//printf("%s", next((ListIter, ptr)));
				//if((!next(ListIter, ptr))) 
				// printf("%s", ptr);
				//	printf(" in ");
				//	printf("%s", ptr);
				//	printf("%s",((struct myEntry*)ptr)->name);
				//	printf(" "); printf("%s", s);printf(";");
				if (strcmp(((struct myEntry*)ptr)->name, s)==0){
					//printf("true ");
					return (struct myEntry*)ptr;
				}
				//else printf("false ");
			}
			//printf("next ");
		}
	}
	//printf("false");
	return NULL;
}

struct myEntry* check_Env (struct Env *self, char* s) {
	ListIter *ptr2;
	ListIter *ptr;
	//ptr1=(ListIter*)front_List(&(e->Stable));
	//printf(" %p", (struct myEntry*)ptr1);
	ptr2=(ListIter*)back_List(&(self->Stable));
	//printf(" %p", (struct myEntry*)ptr2);
	if (ptr2!=NULL){
		for(ptr=(ListIter*)front_List(&(self->Stable)); ptr!=(ptr2-7); ptr=ptr-7){
			//printf(" %s", ((struct myEntry*)ptr)->name);
			if (strcmp(((struct myEntry*)ptr)->name, s)==0){
				//printf("true ");
				return (struct myEntry*)ptr;
			}
			//else printf("false ");
		}
		return NULL;
	}
}

#endif